﻿using System;

namespace STeaL.Functional {

#region Func<T,T,bool> derived from IComparable<T>.ComapreTo()
  public static class rel_op {
    public static bool      equal_to<T>(T x, T y) where T : IComparable<T> { return x.CompareTo(y) == 0; }
    public static bool  not_equal_to<T>(T x, T y) where T : IComparable<T> { return x.CompareTo(y) != 0; }
    public static bool       greater<T>(T x, T y) where T : IComparable<T> { return x.CompareTo(y)  > 0; }
    public static bool          less<T>(T x, T y) where T : IComparable<T> { return x.CompareTo(y)  < 0; }
    public static bool greater_equal<T>(T x, T y) where T : IComparable<T> { return x.CompareTo(y) >= 0; }
    public static bool    less_equal<T>(T x, T y) where T : IComparable<T> { return x.CompareTo(y) <= 0; }
  }
#endregion

}
